<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="tr09" uri="http://www.51i-star.com/news"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单列表</title>
<script type="text/javascript" src="js/jquery-3.1.0.js"></script>
<script type="text/javascript">
	function fh(id,x,curpage){
		if(x == 1 || x==2){
			alert("该订单已发货");
			return false;
		} 
		var a=confirm("您确定要发货吗？");
		 if(a==true){
			 alert("发货成功")
			 location.href="SendOrder?id="+id+"&curpage="+curpage;
		 }
	}
	function order(id){
		location.href="OrderMain?id="+id;
	}
</script>
<style type="text/css">
* {
	margin: 0px;
	padding: 0px;
}
body{
background: #e8e8e8;
}
.t1 {
	float: right;
	height: 26px;
	line-height: 26px;
	padding: 0 10px 0 23px;
	background: #56bbeb;
	border-radius: 3px;
	color: #fff;
	font-size: 13px;
	font-weight: normal;
	text-align: center;
	cursor: pointer;
	text-decoration: none;
	margin-right: 20px;
}

.t2 {
	background: #f3f3f3 repeat-x;
	border: 1px solid #ddd;
	padding: 5px;
	color: #808080;
	margin: 0 0 10px 0;
		font-size: 12px;
}

.t3 {
	border-collapse: collapse;
	border: none;
	width: 100%;
}

.t3 td{
		text-align: center;
	}
	
	th,td{
		padding: 8px;
		border: none;
		border-bottom: 1px solid #CCC;
	}
	
	th{
		color: gray;
		border:1px #CCC solid;
		background: #f3f3f3;
	}
	
	td{
		border-bottom: 1px dashed #CCC;
		border-left: 1px dashed #CCC;
		font-size: 12px;
		background: white;
	}

.t4 {
	
}

.t5 {
	background: #e8e8e8;
	border: 0px red solid;
	height: 70px;
}

.t6 {
	padding-top: 19px;
	font-size: 18px;
	border-bottom: 1px solid #ccc;
}
a {
	color: -webkit-link;
	text-decoration: underline;
	cursor: pointer;
}

input.button {
	padding: 5px 15px 5px;
	margin: 2px 2px;
	border: none;
	background: #56bbeb;
	color: #FFF;
	cursor: pointer;
	border-radius: 3px;
}

img {
	vertical-align: middle;
}

.pager {
	text-align: right;
	padding: 10px;
	background: white;
}

.pager a {
	text-decoration: none;
	color: gray;
}

.pager span {
	font-size: 12px;
	color: gray;
}
p, td, div {
    font: 12px Microsoft Yahei, "sans-serif", "Arial", "Verdana";
}
</style>

</head>


<body>

	<div class="t5">
		<h1 class="t6">
			小熊猫 管理中心—订单列表<a href="orderselect.jsp" class="t1">订单查询</a>
		</h1>
	</div>
	<div class="t2">
		<form action="OrderText">
			<input type="hidden" name="curpage" value="1">
			<input type="hidden" name="pagesize" value="5">
			<img src="image/后台图片/icon_search.gif" border="0" alt="SEARCH"> 订单号：<input name="txt">
			收货人：<input name="name"> <select name="state" id="status">
				<option >请选择</option>
				<option >待付款</option>
				<option >已付款</option>
				<option >待发货</option>
				<option >已发货</option>
				<option >已成交</option>
				<option >退货</option>
			</select>
			<input type="submit" value=" 搜索 "
				class="button">
		</form>
	</div>
	<div>

		<table class="t3">
			<tr>
				<th>订单号</th>
				<th>下单时间</th>
				<th>收货人</th>
				<th>总金额</th>
				<th>应付金额</th>
				<th>订单状态</th>
				<th>操作</th>

			</tr>
			
			<c:forEach items="${list}" var="c">
				<tr>
				<td>${c.orderAddress}</td>
				<td>${c.orderTime}</td>
				<td>${c.orderReceipt}</td>
				<td>${c.orderTotalAmoun}</td>
				<td>${c.orderMoney}</td>
				<td>${c.orderState}</td>
				<td>
				<c:if test="${c.orderState == '已发货'}" var="result">
				
				</c:if>
				<c:if test="${not result}">
								<a onclick="fh(${c.orderAddress},${c.orderState == '已发货'?1:c.orderState == '取消'?2:3},${param.curpage})"><img title="发货" src="image/后台图片/发货.png"></a>
				</c:if>
				<a onclick="order(${c.orderAddress})"><img title="查看" src="image/后台图片/查看订单.png"></a>
				</td>
				
				</tr>
			</c:forEach>
				
			
		</table>
	</div>
	<div class="pager">
		<tr09:pager url="OrderText" pagesize="5" total="${total}"
			curpage="${param.curpage}" />
	</div>
</body>
</html>